import request from '@/utils/request'

// 查询客户列表
export function listCustomer(query) {
	return request({
		url: '/system/customer/list',
		method: 'get',
		params: query
	})
}

// 查询客户详情
export function getCustomer(customerId) {
	return request({
		url: '/system/customer/' + customerId,
		method: 'get'
	})
}

// 新增客户
export function addCustomer(data) {
	return request({
		url: '/system/customer',
		method: 'post',
		data: data
	})
}

// 修改客户
export function updateCustomer(data) {
	return request({
		url: '/system/customer',
		method: 'put',
		data: data
	})
}

// 删除客户
export function delCustomer(customerId) {
	return request({
		url: '/system/customer/' + customerId,
		method: 'delete'
	})
}

// 查询客户订单列表
export function listOrderCustomer(query) {
	return request({
		url: '/system/order/customer/list',
		method: 'get',
		params: query
	})
}

// 修改用户绑定的业务员
export function updateCustomerSalesman(data) {
	return request({
		url: '/system/customer/salesman',
		method: 'post',
		data: data
	})
}